% Testing the network

function [networkSorted] = hw8Test(unsortedArray, network)
[numElems, arrSize] = size(unsortedArray);
runs = zeros(1, numElems);
nonzeros = zeros(1, numElems);
for i=1:numElems
    correctSort = sort(unsortedArray(i,:));

    networkSorted = hw8TestSort(unsortedArray(i,:), network);

    result = correctSort - networkSorted;
    for j=1:arrSize
        if(result(j) ~= 0)
            nonzeros(1,i) = nonzeros(1,i) + 1;
        end
    end
    runs(1,i) = i;
end

disp('Sorted By Network');
disp(networkSorted);

